package cn.edu.cqut.mdm.container;

import java.util.HashMap;
import java.util.Map;

import cn.edu.cqut.mdm.core.publisherdispatcher.PublisherDispatcher;

public class PublisherDispatcherContainer {
	private static PublisherDispatcherContainer instance = new PublisherDispatcherContainer();
	private Map<String, PublisherDispatcher> publisherDispatchers = new HashMap<String, PublisherDispatcher>();
	
	private PublisherDispatcherContainer(){
	}
	
	public static PublisherDispatcherContainer getInstance(){
		return instance;
	}
	
	public void addPublisherDispatcher(String name, PublisherDispatcher publisherDispatcher) {
		this.publisherDispatchers.put(name, publisherDispatcher);
	}
	
	public PublisherDispatcher getPublisherDispatcher(String name) {
		return this.publisherDispatchers.get(name);
	}
	
	public Map<String, PublisherDispatcher> getAllPublisherDispatcherMap() {
		return this.publisherDispatchers;
	}
}
